home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / util / misc / cookietool.lha / cookietool / strstuff.h < prev   
Encoding:
C/C++ Source or Header  |  2000-06-25  |  2.1 KB  |  48 lines

  1. /*
  2.     cookietool is (c) 1995-2000 by Wilhelm Noeker (wnoeker@t-online.de)
  3.  
  4.     This program is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU General Public License as
  6.     published by the Free Software Foundation; either version 2 of the
  7.     License, or (at your option) any later version.
  8.  
  9.     This program is distributed in the hope that it will be useful, but
  10.     WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12.     General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU General Public License
  15.     along with this program; if not, write to the Free Software
  16.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  17.     02111-1307 USA
  18.     
  19.  */
  20.  
  21. /*========================================================================*\
  22.  |  File: strstuff.h                                   Date: 20 Sep 1997  |
  23.  *------------------------------------------------------------------------*
  24.  |   Some string functions, similar to those from the standard library    |
  25.  |                  in <string.h>, but more flexible.                     |
  26.  |   You must call str_setup() before using any of these functions !!!    |
  27.  |                                                                        |
  28. \*========================================================================*/
  29.  
  30. typedef unsigned char UBYTE;
  31.  
  32. /* special return values for str_cmp() and strn_cmp() */
  33. #define STR_LONGER   256   
  34. #define STR_SHORTER -256
  35.  
  36. /* possible values for bordermode (treatment of word delimiters): */
  37. #define BM_FUSSY       3  /* compare char by char */
  38. #define BM_DONTCOUNT   2  /* number (and kind) of spaces doesn't matter */
  39. #define BM_SPACEPUNCTS 1  /* treat punctuation like spaces */
  40. #define BM_MERGE       0  /* merge all alphanumerics into one single word */
  41.  
  42. void   str_setup    ( int bordermode, int case_sense );
  43. int    str_cmp      ( UBYTE *s, UBYTE *t );
  44. int    strn_cmp     ( UBYTE *s, UBYTE *t, size_t n );
  45. UBYTE *str_str      ( UBYTE *s, UBYTE *t );
  46. void   print_strstat( void );
  47.  
  48.